#include "Socket.h"

#include <iostream>

using namespace std;

int main() {

  try {
    SocketClient s("localhost", 2000);

    s.SendLine("Hello!");
    s.SendLine("This is easy.");
    s.SendLine("Check out it worked!");

	cout << "Type a key and press enter to send to the server.";
	string key;
    while (1) {
	  cin >> key;
      s.SendLine(key);
    }

  } 
  catch (const char* s) {
    cerr << s << endl;
  } 
  catch (std::string s) {
    cerr << s << endl;
  } 
  catch (...) {
    cerr << "unhandled exception\n";
  }

  return 0;
}